import request from '@/utils/request'

// 查询投资主体列表
export function listDealInvestment(query) {
  return request({
    url: '/investment/YueYinDealInvestment/list',
    method: 'post',
    data: query
  })
}

// 查询投资主体列表 不分页
export function listDealInvestmentAll(query) {
  return request({
    url: '/investment/YueYinDealInvestment/listAll',
    method: 'post',
    data: query
  })
}

// 查询投资主体详细
export function getDealInvestment(id) {
  return request({
    url: '/investment/YueYinDealInvestment/' + id,
    method: 'get'
  })
}

// 保存投资主体
export function saveDealInvestment(data) {
  return request({
    url: '/investment/YueYinDealInvestment/save',
    method: 'post',
    data: data
  })
}

// 删除投资主体
export function delDealInvestment(id) {
  return request({
    url: '/investment/YueYinDealInvestment/' + id,
    method: 'delete'
  })
}

// 导出投资主体
export function exportDealInvestment(query) {
  return request({
    url: '/investment/YueYinDealInvestment/export',
    method: 'get',
    params: query
  })
}

// 根据项目ID获取当前项目全部投资主体
export function findByDealId(dealId) {
  return request({
    url: '/investment/YueYinDealInvestment/findByDealId/' + dealId,
    method: 'get'
  })
}

// 投后视图  投资信息
export function getByIdFindPostInvestmentInformation(dealId, companyId) {
  return request({
    url: '/investment/YueYinDealInvestment/getByIdFindPostInvestmentInformation/' + dealId + '/' + companyId,
    method: 'get'
  })
}

// 上市项目证券账户持仓信息
export function findByDealIdAndInvestorId(dealId, investorId) {
  return request({
    url: '/investment/YueYinDealInvestment/findByDealIdAndInvestorId/' + dealId + '/' + investorId,
    method: 'get'
  })
}

// 投资期 投资情况 饼状图
export function investmentPieChart(fundId) {
  return request({
    url: '/investment/YueYinDealInvestment/investmentPieChart/' + fundId,
    method: 'get'
  })
}

// 根据公司ID获取使用该公司项目的全部投资主体
export function findByCompanyId(companyId) {
  return request({
    url: '/investment/YueYinDealInvestment/findByCompanyId/' + companyId,
    method: 'get'
  })
}

export function getCashFlow(investorId, dealId) {
  return request({
    url: '/investment/YueYinDealInvestment/getCashFlow/' + investorId + '/' + dealId,
    method: 'get'
  })
}
